package com.zyk.script.manager.plugins;

import com.zyk.script.manager.plugin.IScriptPlugin;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Properties;

public class PrintPlugin implements IScriptPlugin {
    private final Logger logger = LoggerFactory.getLogger(PrintPlugin.class);
    @Override
    public void run(String[] args, Properties properties) {
        logger.info("打印启动配置");
        logger.info("args：" + String.join("|", args == null ? new String[0] : args));
        logger.info("properties：");
        for (String stringPropertyName : properties.stringPropertyNames()) {
            logger.info("   " + stringPropertyName + ":" + properties.get(stringPropertyName));
        }
        logger.info("打印完成");
    }

    @Override
    public String getName() {
        return "PrintPlugin";
    }
}